﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ECatalog.Models.Logger
{
    public static class Logger
    {
        public static void AddToLog(bool isModel, bool isPrint, bool isSearch, int itemId)
        {
            var stat = new StatModel
                {
                    DateTime = DateTime.Now,
                    IsModel = isModel,
                    IsPrint = isPrint,
                    IsSearch = isSearch,
                    ItemId = itemId
                };

            using (var dbContainer = new DbContainer())
            {
                try
                {
                    dbContainer.StatModels.Add(stat);
                    dbContainer.SaveChanges();
                }
                catch (Exception)
                {
                    
                }
            }

        }
    }
}